vis = [0] * 10
a = ['', 'a', 'b', 'c']
def dfs(k):                #深搜索到第k个
    if k == n + 1:
        for i in range(1, n + 1):
            if vis[i] == 1:
                print(a[i], end='')
        print()
    else:
        vis[k] = 0
        dfs(k + 1)
        vis[k] = 1
        dfs(k + 1)

n = int(input())
dfs(1)
